<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户中心</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        .header {
            background-color: #fff;
            padding: 20px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            margin-bottom: 20px;
            border-radius: 5px;
        }
        .header h1 {
            color: #333;
            text-align: center;
        }
        .tab-container {
            display: flex;
            margin-bottom: 20px;
        }
        .tab {
            padding: 10px 20px;
            background-color: #eee;
            cursor: pointer;
            border: 1px solid #ddd;
            flex: 1;
            text-align: center;
            transition: all 0.3s;
        }
        .tab:first-child {
            border-radius: 5px 0 0 5px;
        }
        .tab:last-child {
            border-radius: 0 5px 5px 0;
        }
        .tab.active {
            background-color: #4CAF50;
            color: white;
            border-color: #4CAF50;
        }
        .content {
            background-color: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .tab-content {
            display: none;
        }
        .tab-content.active {
            display: block;
        }
        .form-group {
            margin-bottom: 15px;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        .form-control {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 16px;
        }
        .btn {
            padding: 10px 20px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s;
        }
        .btn:hover {
            background-color: #45a049;
        }
        .collection-list {
            list-style: none;
        }
        .collection-item {
            padding: 15px;
            border-bottom: 1px solid #eee;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .collection-item:last-child {
            border-bottom: none;
        }
        .avatar-container {
            text-align: center;
            margin-bottom: 20px;
        }
        .avatar {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            object-fit: cover;
            border: 5px solid #eee;
        }
        .error-message {
            color: #f44336;
            margin-top: 5px;
            font-size: 14px;
        }
        .success-message {
            color: #4CAF50;
            margin-top: 5px;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>用户中心</h1>
        </div>
        
        <div class="tab-container">
            <div class="tab active" data-tab="favorites">收藏列表</div>
            <div class="tab" data-tab="avatar">修改头像</div>
            <div class="tab" data-tab="register">用户注册</div>
        </div>
        
        <div class="content">
            <!-- 收藏列表 -->
            <div class="tab-content active" id="favorites">
                <h2>我的收藏</h2>
                <p>以下是您收藏的内容：</p>
                <ul class="collection-list" id="collection-list">
                    <li class="collection-item">
                        <span>加载中...</span>
                    </li>
                </ul>
            </div>
            
            <!-- 修改头像 -->
            <div class="tab-content" id="avatar">
                <h2>修改头像</h2>
                <div class="avatar-container">
                    <img src="https://via.placeholder.com/150" alt="用户头像" class="avatar" id="current-avatar">
                </div>
                <form id="avatar-form">
                    <div class="form-group">
                        <label for="avatar-upload">选择新头像</label>
                        <input type="file" id="avatar-upload" class="form-control" accept="image/*">
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn">上传头像</button>
                    </div>
                    <div id="avatar-message"></div>
                </form>
            </div>
            
            <!-- 用户注册 -->
            <div class="tab-content" id="register">
                <h2>用户注册</h2>
                <form id="register-form">
                    <div class="form-group">
                        <label for="username">用户名</label>
                        <input type="text" id="username" class="form-control" placeholder="请输入用户名" required>
                    </div>
                    <div class="form-group">
                        <label for="email">电子邮箱</label>
                        <input type="email" id="email" class="form-control" placeholder="请输入电子邮箱" required>
                    </div>
                    <div class="form-group">
                        <label for="password">密码</label>
                        <input type="password" id="password" class="form-control" placeholder="请输入密码" required>
                    </div>
                    <div class="form-group">
                        <label for="confirm-password">确认密码</label>
                        <input type="password" id="confirm-password" class="form-control" placeholder="请再次输入密码" required>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn">注册</button>
                    </div>
                    <div id="register-message"></div>
                </form>
            </div>
        </div>
    </div>

    <script src="app.js"></script>
</body>
</html>